/*
 * @Description: 交易类型-冻结
 * @Author: yingying.fan
 * @Date: 2019-03-18 13:38:28
 * @Last Modified by: yingying.fan
 * @Last Modified time: 2019-03-18 15:31:07
 */
<script>
import BaseConsumeItem from './BaseConsumeItem'
import { FREEZON_MEAL, FREEZON_PAY_BUS_ON } from '../../../consumedetail/constants/TradeDetailType.js'
export default {
  name: 'ConsumeRefundItem',
  extends: BaseConsumeItem,
  watch: {
    tradeDetailType(newValue, oldValue) {
      switch (newValue) {
        case FREEZON_MEAL:
          this.iconUrl = require('../../assets/freezon.png')
          this.tradeText = '员工餐金额冻结'
          break
        case FREEZON_PAY_BUS_ON:
          this.iconUrl = require('../../assets/bus.png')
          this.tradeText = '乘坐公交'
          break
      }
    }
  },
  methods: {
    // 交易失败
    parseWhenTradeFailure() {

    },
    // 交易退款
    parseWhenTradeRefund() {
      this.stateDesc = '已解冻'
    },
    // 交易成功
    parseWhenTradeSuccess() {
      if (this.tradeDetailType === FREEZON_PAY_BUS_ON) {
        this.stateDesc = '乘车中，冻结' + this.payPrice + '元'
      } else {
        this.payFeeDesc = '-' + this.payPrice
      }
    },
    // 交易中
    parseWhenTrading() {

    }
  }
}
</script>
